Ext.define('HIT.view.DealOrderPanel', {
    extend: 'Ext.form.Panel',
    alias: 'widget.dealorderpanel',
//排序字段panel
    anchor: '100%',
    margin: '10 0 10',
    height: 24,
    frame:false,
    layout: {
        type: 'absolute'
    },
    title: '',
    
    initComponent: function() {
        var me = this;
     
        Ext.applyIf(me, {
        	items: [
					{
					    xtype: 'combobox',							   
					    x:10,
					    y:0,
					    labelWidth:60,
					    fieldLabel: Share.T('字段'),
					    width: 190,                          
					    editable: false,
					    msgTarget:'side',
					    allowBlank:false,
                        blankText:Share.T('字段不能为空'),
					    valueField : 'value',
        				displayField : 'text',
        				store : new Ext.data.JsonStore({
	            					proxy: { 
	                	                type: 'ajax', 
	                	                url : ctx + '/getDealFieldList',
	                	                params:{        	                	
	                	                },
	                	                reader: { 
	                	                    type: 'json', 
	                	                    totalProperty: '', 
	                	                    root: '' 
	                	                } 
	                	        }, 
	                	        fields:['text','value'], 
	                	        autoLoad:true 
        				})
////       	     ,
////				listeners : {
////					select : function(combo,records,e) {//过滤已选择过的字段，之后不可再做选择
////					 	var selectVal = records[0].raw.value;
//////    					if(!e.forceAll){     
////    						combo.store.filterBy(function(record,id){   
////    							var value = record.get(combo.valueField); 
////    							return (value != selectVal);   
////    						});
////    						combo.expand();   
////    						return false;   
//////    					}
////					}
////				}
				},
				{
 				    xtype: 'combobox',						   
 				    x:200,
 				    y:0,						
 				    width: 60,                          
 				    editable: false,	
 				    msgTarget:'side',
				    allowBlank:false,
                    blankText:Share.T('请选择排序'),
 				    hideTrigger : true,
 					store: new Ext.data.JsonStore({  
    					proxy: { 
        	                type: 'ajax', 
        	                url : ctx + '/getComboData',
        	                params:{
        	                },
        	                reader: { 
        	                    type: 'json', 
        	                    totalProperty: '', 
        	                    root: '' 
        	                } 
        	             }, 
        	            fields:['text','value'], 
        	            autoLoad:true 
			        }),
			        listeners : {
			        	beforerender:function(){
			        		this.store.removeAll();
			        		this.store.on('beforeload', function(store) {
			        			Ext.apply(store.proxy.extraParams , {
			        				type : 'dealorder'
			        			});
			        		});
			        		this.store.load();
			        	}
			        },
	 				valueField   : 'value',
	 				displayField : 'text'
             },
            {
                xtype: 'button',
                text: Share.T('删除字段'),
                x:340,
                y:0,
                handler:function(){             	
              		this.up('form').up('panel').remove(me,true);
                }
            }
		   ]                                            
         });
        me.callParent(arguments);
        
        
    }

});